# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidPublisher.V3.Model.User do
  @moduledoc """
  A user resource.

  ## Attributes

  *   `accessState` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the user's access to the Play Console.
  *   `developerAccountPermissions` (*type:* `list(String.t)`, *default:* `nil`) - Permissions for the user which apply across the developer account.
  *   `email` (*type:* `String.t`, *default:* `nil`) - Immutable. The user's email address.
  *   `expirationTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which the user's access expires, if set. When setting this value, it must always be in the future.
  *   `grants` (*type:* `list(GoogleApi.AndroidPublisher.V3.Model.Grant.t)`, *default:* `nil`) - Output only. Per-app permissions for the user.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Resource name for this user, following the pattern "developers/{developer}/users/{email}".
  *   `partial` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether there are more permissions for the user that are not represented here. This can happen if the caller does not have permission to manage all apps in the account. This is also `true` if this user is the account owner. If this field is `true`, it should be taken as a signal that this user cannot be fully managed via the API. That is, the API caller is not be able to manage all of the permissions this user holds, either because it doesn't know about them or because the user is the account owner.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessState => String.t() | nil,
          :developerAccountPermissions => list(String.t()) | nil,
          :email => String.t() | nil,
          :expirationTime => DateTime.t() | nil,
          :grants => list(GoogleApi.AndroidPublisher.V3.Model.Grant.t()) | nil,
          :name => String.t() | nil,
          :partial => boolean() | nil
        }

  field(:accessState)
  field(:developerAccountPermissions, type: :list)
  field(:email)
  field(:expirationTime, as: DateTime)
  field(:grants, as: GoogleApi.AndroidPublisher.V3.Model.Grant, type: :list)
  field(:name)
  field(:partial)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidPublisher.V3.Model.User do
  def decode(value, options) do
    GoogleApi.AndroidPublisher.V3.Model.User.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidPublisher.V3.Model.User do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
